package com.example.demo.service.My;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.demo.myModel.entity.Email;
import com.example.demo.myModel.entity.Teacher;
import com.example.demo.myModel.otd.user.AdminLoginRequest;
import com.example.demo.myModel.vo.AdminLoginVo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

public interface TeacherService extends IService<Teacher> {

    /**
     *
     * 获取脱敏的已登录管理员信息
     */
    AdminLoginVo getLoginAdminVO(Teacher teacher);


    /**
     * 管理员注册
     * @param teacher 请求类
     * @return {
     *     long
     * }
     */
    Long adminRegister(Teacher teacher, HttpSession session);

    /**
     * 管理员登录（超级管理员/赛事管理员）
     * @param adminLoginRequest 请求实体
     * @param request 请求信息
     * @return {
     *     AdminLonginVo
     * }
     */
    AdminLoginVo adminLogin(AdminLoginRequest adminLoginRequest, HttpServletRequest request);


    /**
     * 发送邮箱验证码
     * @param email
     * @return
     */
    boolean sentEmailCode(Email email, HttpSession session);


    /**
     * 生成n位随机数
     * @param n
     * @return
     */
    String randomCode(int n);

    /**
     * 验证注册码
     * @param info
     * @param session
     * @return
     */
    boolean registered(Teacher info, HttpSession session);
}
